package com.atguigu.jxc.domain;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @description 后端返回的实体
 */
@Data
public class ServiceVO<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    //返回状态码
    private int code;

    private String msg;

    private T info;

    //返回数据
    private Map<String, Object> data = new HashMap<String, Object>();

    

    public ServiceVO(){

    }

    public ServiceVO(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ServiceVO(int code, String msg, T info) {
        this.code = code;
        this.msg = msg;
        this.info = info;
    }

    public ServiceVO data(Map<String, Object> map){
        this.setData(map);
        return this;
    }

}
